﻿<UserControl x:Class="Nizm0.QOT.Library.Controls.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Expander ExpandDirection="Right"
                        Grid.Column="0"
                        Grid.Row="0"
                        Grid.RowSpan="2"
                        Header="Documents"
                        IsExpanded="False">

            <Grid>

                <Grid.RowDefinitions>
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Grid Grid.Row="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50" />
                    </Grid.RowDefinitions>
                </Grid>

                <ListBox Name="listBox"
                             Grid.Row="1"
                             ItemsSource="{Binding Path=Items}"
                             SelectedIndex="{Binding Path=SelectedIndex}"
                             SelectedItem="{Binding Path=SelectedItem}"
                             SelectionMode="Single"
                             Width="250">

                    <ListBox.ItemTemplate>

                        <DataTemplate>

                            <Grid>

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>

                                <Grid.RowDefinitions>
                                    <RowDefinition Height="auto" />
                                </Grid.RowDefinitions>

                                <TextBlock Grid.Column="0"
                                                 Style="{StaticResource prompt}">
                            <TextBlock.Text>
                                <MultiBinding StringFormat="{}{0}{1:00000}">
                                    <Binding Path="..."
                                                     FallbackValue="0" />
                                    <Binding Path="..." />
                                </MultiBinding>
                            </TextBlock.Text>
                                </TextBlock>

                                <TextBlock Grid.Column="1"
                                                 Style="{StaticResource prompt}">
                            <TextBlock.Text>
                                <Binding Path="ItemCount"
                                                 StringFormat="{}{0} Items"
                                                 FallbackValue="" />
                            </TextBlock.Text>
                                </TextBlock>

                            </Grid>

                        </DataTemplate>

                    </ListBox.ItemTemplate>
                </ListBox>

            </Grid>

        </Expander>

        <Label x:Name="documentView"
                                    Grid.Column="1"
                                    Grid.Row="0"/>

        <StackPanel Grid.Column="1"
                            Grid.Row="1"
                            Style="{StaticResource buttonStackStyle}">

            <Button Command="{Binding Path=PreviousCommand}"
                        Style="{StaticResource previousButtonStyle}" />

            <Button Command="{Binding Path=NextCommand}"
                        Style="{StaticResource nextButtonStyle}" />

        </StackPanel>

    </Grid>
</UserControl>
